package com.pronhub.luowowo.website.web.controller;

import com.pronhub.luowowo.util.AjaxResult;
import com.pronhub.luowowo.website.web.util.UploadUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

@Controller
public class ImageUploadController {

    @Value("${file.path}")
    private String path;
    @RequestMapping("coverImageUpload")
    @ResponseBody
    public String coverImageUpload(MultipartFile pic){
        String filename = UploadUtil.upload(pic, path);
        return filename;
    }
}
